/*
 * Copyright (c) 2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const Map<String, String> allXml = {
  'books.xml': booksXml,
  'bookstore.xml': bookstoreXml,
  'atom.xml': atomXml,
  'shiporder.xsd': shiporderXsd,
  'complicated.xml': complicatedXml,
  'unicode.xml': unicodeXml,
  'control_characters.xml': controlCharactersXml,
};

const String booksXml = '<?xml version="1.0"?>'
    '<catalog>'
    '   <book id="bk101">'
    '      <author>Gambardella, Matthew</author>'
    '      <title>XML Developer\'s Guide</title>'
    '      <genre>Computer</genre>'
    '      <price>44.95</price>'
    '      <publish_date>2000-10-01</publish_date>'
    '      <description>An in-depth look at creating applications '
    '      with XML.</description>'
    '   </book>'
    '</catalog>';

const String bookstoreXml = '<?xml version="1.0" encoding="ISO-8859-1"?>\n'
    '<bookstore>\n'
    '  <book>\n'
    '    <title lang="eng">Harry Potter</title>\n'
    '    <price>29.99</price>\n'
    '  </book>\n'
    '</bookstore>';

const String atomXml = '<?xml version="1.0" encoding="UTF-8"?>'
    '<app:service>'
    '  <app:workspace>'
    '    <cmisra:repositoryInfo xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/">'
    '    </cmisra:repositoryInfo>'
    '  </app:workspace>'
    '</app:service>';

const String shiporderXsd = '<?xml version="1.0"?>'
    '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">'
    '  <xsd:complexType name="PurchaseOrderType">'
    '    <xsd:sequence>'
    '      <xsd:element name="shipTo" type="USAddress"/>'
    '    </xsd:sequence>'
    '    <xsd:attribute name="orderDate" type="xsd:date"/>'
    '  </xsd:complexType>'
    '</xsd:schema>';

const String complicatedXml = '<?xml version="1.0"?>\n'
    '<!DOCTYPE name [ <!ELEMENT html (head, body)> ]>\n'
    '<ns:foo attr="not namespaced" n1:ans="namespaced 1" '
    '        n2:ans="namespace 2" >\n'
    '  Plain text contents!'
    '  <element/>\n'
    '  <ns:element/>\n'
    '  <!-- comment -->\n'
    '  <![CDATA[cdata]]>\n'
    '  <?processing instruction?>\n'
    '</ns:foo>';

const String unicodeXml = '<?xml version="1.1" encoding="UTF-8"?>\n'
    '<電文情報 version="5.0">\n'
    '<生年月日>昭和２８年２月１日</生年月日>\n'
    '<性別>男</性別>\n'
    '</電文情報>\n';

const String controlCharactersXml = '<?xml version="1.0"?>\n'
    '<name attr="bell\u0007">del\u007fbackspace\u0008null\u0000</name>';
